/**
 * @author zyj
 * @date 2022年06月06日 11:39
 */
public class MyRunableDemo {
    public static void main(String[] args) {
        //实现Runable接口，实现run方法来开启线程
        MyRunable runable = new MyRunable();
        //开启线程
//        创建一个Thread对象，通过thread对象来开启线程
        //Thread(Runnable target, String name)
        //Thread(Runnable target)
        new Thread(runable).start();
        new Thread(runable).start();
    }
}

class MyRunable implements Runnable{

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName() + ":" + i);
        }
    }
}
